<template>
  <div class="city">
   city
   <button v-for="(item,index) of hots" :key="index" @click="handleCity(item)">{{item}}</button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      hots:['武汉','上海','杭州']
    }
  },
  methods: {
    handleCity(city){
      localStorage.setItem('city',city)
      this.$router.back()
    }
  },
}
</script>
